#ifndef QENUMPROPERTY_H
#define QENUMPROPERTY_H


#include "../../libs/sharedlib/qabstractproperty.h"
#include "../../libs/sharedLib/qcommonstruct.h"

#include <QComboBox>

class QEnumEditor : public QComboBox
{
    Q_OBJECT
    Q_PROPERTY(QVariant m_value READ value WRITE setValue USER true)
public:
    QEnumEditor(const ComboItems &items);
    void        setValue(const QVariant &value);
    QVariant    value();
protected:
    QVariant        m_value;
    ComboItems      m_items;
};


class QEnumProperty: public SHAREDLIB::QAbstractProperty
{
    Q_OBJECT
public:
    QEnumProperty(SHAREDLIB::QAbstractProperty* parent=0);
    void            valueXML(QXmlStreamWriter *w);
    QWidget*        getEditor();
    QIcon           valueIcon();
    QString         valueText();
protected slots:
    void            editorValueChanged(const QString &text);
    void            value_changed();
};


#endif // QENUMPROPERTY_H
